package com.lazyben.server;

import com.lazyben.model.Message;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;

public class MessageContainer {
    private static final BlockingQueue<Message> mq = new LinkedBlockingQueue<>(100);

    public static Message get() {
        try {
            return mq.take();
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }

    public static void add(Message message) {
        mq.add(message);
    }
}
